package com.yc.auction.entity;

/**
 * 竞拍信息
 * @author navy
 */
public class BidInfo {
	private int bid; //竞拍编号
	private int usid; //竞拍人编号
	private int pid; //竞拍的商品编号
	private String createTime; //竞拍时间
	private double price; //竞拍价
	
	private ProductInfo productInfo; //竞拍商品信息
	private Users users; //竞拍人
	
	@Override
	public String toString() {
		return "BidInfo [bid=" + bid + ", usid=" + usid + ", pid=" + pid
				+ ", createTime=" + createTime + ", price=" + price
				+ ", productInfo=" + productInfo + ", users=" + users + "]";
	}

	public int getBid() {
		return bid;
	}

	public void setBid(int bid) {
		this.bid = bid;
	}

	public int getUsid() {
		return usid;
	}

	public void setUsid(int usid) {
		this.usid = usid;
	}

	public int getPid() {
		return pid;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public ProductInfo getProductInfo() {
		return productInfo;
	}

	public void setProductInfo(ProductInfo productInfo) {
		this.productInfo = productInfo;
	}

	public Users getUsers() {
		return users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

	public BidInfo(int bid, int usid, int pid, String createTime, double price,
			ProductInfo productInfo, Users users) {
		super();
		this.bid = bid;
		this.usid = usid;
		this.pid = pid;
		this.createTime = createTime;
		this.price = price;
		this.productInfo = productInfo;
		this.users = users;
	}

	public BidInfo() {
		super();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + bid;
		result = prime * result
				+ ((createTime == null) ? 0 : createTime.hashCode());
		result = prime * result + pid;
		long temp;
		temp = Double.doubleToLongBits(price);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result
				+ ((productInfo == null) ? 0 : productInfo.hashCode());
		result = prime * result + ((users == null) ? 0 : users.hashCode());
		result = prime * result + usid;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BidInfo other = (BidInfo) obj;
		if (bid != other.bid)
			return false;
		if (createTime == null) {
			if (other.createTime != null)
				return false;
		} else if (!createTime.equals(other.createTime))
			return false;
		if (pid != other.pid)
			return false;
		if (Double.doubleToLongBits(price) != Double
				.doubleToLongBits(other.price))
			return false;
		if (productInfo == null) {
			if (other.productInfo != null)
				return false;
		} else if (!productInfo.equals(other.productInfo))
			return false;
		if (users == null) {
			if (other.users != null)
				return false;
		} else if (!users.equals(other.users))
			return false;
		if (usid != other.usid)
			return false;
		return true;
	}
}
